Integrand size = 40, antiderivative size = 91 \[ \int \frac {\cos (c+d x) \left (B \sec (c+d x)+C \sec ^2(c+d x)\right )}{\sqrt {a+a \sec (c+d x)}} \, dx=\frac {2 B \arctan \left (\frac {\sqrt {a} \tan (c+d x)}{\sqrt {a+a \sec (c+d x)}}\right )}{\sqrt {a} d}-\frac {\sqrt {2} (B-C) \arctan \left (\frac {\sqrt {a} \tan (c+d x)}{\sqrt {2} \sqrt {a+a \sec (c+d x)}}\right )}{\sqrt {a} d} \]
[Out]
Time = 0.22 (sec) , antiderivative size = 91, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.125, Rules used = {4157, 4005, 3859, 209, 3880} \[ \int \frac {\cos (c+d x) \left (B \sec (c+d x)+C \sec ^2(c+d x)\right )}{\sqrt {a+a \sec (c+d x)}} \, dx=\frac {2 B \arctan \left (\frac {\sqrt {a} \tan (c+d x)}{\sqrt {a \sec (c+d x)+a}}\right )}{\sqrt {a} d}-\frac {\sqrt {2} (B-C) \arctan \left (\frac {\sqrt {a} \tan (c+d x)}{\sqrt {2} \sqrt {a \sec (c+d x)+a}}\right )}{\sqrt {a} d} \]
[In]
[Out]
Rule 209
Rule 3859
Rule 3880
Rule 4005
Rule 4157
Rubi steps \begin{align*} \text {integral}& = \int \frac {B+C \sec (c+d x)}{\sqrt {a+a \sec (c+d x)}} \, dx \\ & = \frac {B \int \sqrt {a+a \sec (c+d x)} \, dx}{a}-(B-C) \int \frac {\sec (c+d x)}{\sqrt {a+a \sec (c+d x)}} \, dx \\ & = -\frac {(2 B) \text {Subst}\left (\int \frac {1}{a+x^2} \, dx,x,-\frac {a \tan (c+d x)}{\sqrt {a+a \sec (c+d x)}}\right )}{d}+\frac {(2 (B-C)) \text {Subst}\left (\int \frac {1}{2 a+x^2} \, dx,x,-\frac {a \tan (c+d x)}{\sqrt {a+a \sec (c+d x)}}\right )}{d} \\ & = \frac {2 B \arctan \left (\frac {\sqrt {a} \tan (c+d x)}{\sqrt {a+a \sec (c+d x)}}\right )}{\sqrt {a} d}-\frac {\sqrt {2} (B-C) \arctan \left (\frac {\sqrt {a} \tan (c+d x)}{\sqrt {2} \sqrt {a+a \sec (c+d x)}}\right )}{\sqrt {a} d} \\ \end{align*}
Time = 0.93 (sec) , antiderivative size = 92, normalized size of antiderivative = 1.01 \[ \int \frac {\cos (c+d x) \left (B \sec (c+d x)+C \sec ^2(c+d x)\right )}{\sqrt {a+a \sec (c+d x)}} \, dx=\frac {2 \left (\sqrt {2} B \arcsin \left (\sqrt {2} \sin \left (\frac {1}{2} (c+d x)\right )\right )+(-B+C) \arctan \left (\frac {\sin \left (\frac {1}{2} (c+d x)\right )}{\sqrt {\cos (c+d x)}}\right )\right ) \cos \left (\frac {1}{2} (c+d x)\right )}{d \sqrt {\cos (c+d x)} \sqrt {a (1+\sec (c+d x))}} \]
[In]
[Out]
Leaf count of result is larger than twice the leaf count of optimal. \(202\) vs. \(2(76)=152\).
Time = 0.43 (sec) , antiderivative size = 203, normalized size of antiderivative = 2.23
method | result | size |
default | \(-\frac {\sqrt {-\frac {2 a}{\left (1-\cos \left (d x +c \right )\right )^{2} \csc \left (d x +c \right )^{2}-1}}\, \sqrt {\left (1-\cos \left (d x +c \right )\right )^{2} \csc \left (d x +c \right )^{2}-1}\, \left (B \ln \left (\csc \left (d x +c \right )-\cot \left (d x +c \right )+\sqrt {\left (1-\cos \left (d x +c \right )\right )^{2} \csc \left (d x +c \right )^{2}-1}\right )-C \ln \left (\csc \left (d x +c \right )-\cot \left (d x +c \right )+\sqrt {\left (1-\cos \left (d x +c \right )\right )^{2} \csc \left (d x +c \right )^{2}-1}\right )-B \sqrt {2}\, \operatorname {arctanh}\left (\frac {\sqrt {2}\, \left (-\cot \left (d x +c \right )+\csc \left (d x +c \right )\right )}{\sqrt {\left (1-\cos \left (d x +c \right )\right )^{2} \csc \left (d x +c \right )^{2}-1}}\right )\right )}{d a}\) | \(203\) |
[In]
[Out]
none
Time = 0.72 (sec) , antiderivative size = 307, normalized size of antiderivative = 3.37 \[ \int \frac {\cos (c+d x) \left (B \sec (c+d x)+C \sec ^2(c+d x)\right )}{\sqrt {a+a \sec (c+d x)}} \, dx=\left [-\frac {\sqrt {2} {\left (B - C\right )} a \sqrt {-\frac {1}{a}} \log \left (-\frac {2 \, \sqrt {2} \sqrt {\frac {a \cos \left (d x + c\right ) + a}{\cos \left (d x + c\right )}} \sqrt {-\frac {1}{a}} \cos \left (d x + c\right ) \sin \left (d x + c\right ) - 3 \, \cos \left (d x + c\right )^{2} - 2 \, \cos \left (d x + c\right ) + 1}{\cos \left (d x + c\right )^{2} + 2 \, \cos \left (d x + c\right ) + 1}\right ) + 2 \, B \sqrt {-a} \log \left (\frac {2 \, a \cos \left (d x + c\right )^{2} + 2 \, \sqrt {-a} \sqrt {\frac {a \cos \left (d x + c\right ) + a}{\cos \left (d x + c\right )}} \cos \left (d x + c\right ) \sin \left (d x + c\right ) + a \cos \left (d x + c\right ) - a}{\cos \left (d x + c\right ) + 1}\right )}{2 \, a d}, \frac {\sqrt {2} {\left (B - C\right )} \sqrt {a} \arctan \left (\frac {\sqrt {2} \sqrt {\frac {a \cos \left (d x + c\right ) + a}{\cos \left (d x + c\right )}} \cos \left (d x + c\right )}{\sqrt {a} \sin \left (d x + c\right )}\right ) - 2 \, B \sqrt {a} \arctan \left (\frac {\sqrt {\frac {a \cos \left (d x + c\right ) + a}{\cos \left (d x + c\right )}} \cos \left (d x + c\right )}{\sqrt {a} \sin \left (d x + c\right )}\right )}{a d}\right ] \]
[In]
[Out]
\[ \int \frac {\cos (c+d x) \left (B \sec (c+d x)+C \sec ^2(c+d x)\right )}{\sqrt {a+a \sec (c+d x)}} \, dx=\int \frac {\left (B + C \sec {\left (c + d x \right )}\right ) \cos {\left (c + d x \right )} \sec {\left (c + d x \right )}}{\sqrt {a \left (\sec {\left (c + d x \right )} + 1\right )}}\, dx \]
[In]
[Out]
Result contains complex when optimal does not.
Time = 0.65 (sec) , antiderivative size = 699, normalized size of antiderivative = 7.68 \[ \int \frac {\cos (c+d x) \left (B \sec (c+d x)+C \sec ^2(c+d x)\right )}{\sqrt {a+a \sec (c+d x)}} \, dx=-\frac {{\left (\sqrt {2} \sqrt {a} \arctan \left (\frac {{\left ({\left | 2 \, e^{\left (i \, d x + i \, c\right )} + 2 \right |}^{4} + 16 \, \cos \left (d x + c\right )^{4} + 16 \, \sin \left (d x + c\right )^{4} + 8 \, {\left (\cos \left (d x + c\right )^{2} - \sin \left (d x + c\right )^{2} - 2 \, \cos \left (d x + c\right ) + 1\right )} {\left | 2 \, e^{\left (i \, d x + i \, c\right )} + 2 \right |}^{2} - 64 \, \cos \left (d x + c\right )^{3} + 32 \, {\left (\cos \left (d x + c\right )^{2} - 2 \, \cos \left (d x + c\right ) + 1\right )} \sin \left (d x + c\right )^{2} + 96 \, \cos \left (d x + c\right )^{2} - 64 \, \cos \left (d x + c\right ) + 16\right )}^{\frac {1}{4}} \sin \left (\frac {1}{2} \, \arctan \left (\frac {8 \, {\left (\cos \left (d x + c\right ) - 1\right )} \sin \left (d x + c\right )}{{\left | 2 \, e^{\left (i \, d x + i \, c\right )} + 2 \right |}^{2}}, \frac {{\left | 2 \, e^{\left (i \, d x + i \, c\right )} + 2 \right |}^{2} + 4 \, \cos \left (d x + c\right )^{2} - 4 \, \sin \left (d x + c\right )^{2} - 8 \, \cos \left (d x + c\right ) + 4}{{\left | 2 \, e^{\left (i \, d x + i \, c\right )} + 2 \right |}^{2}}\right )\right ) + 2 \, \sin \left (d x + c\right )}{{\left | 2 \, e^{\left (i \, d x + i \, c\right )} + 2 \right |}}, \frac {{\left ({\left | 2 \, e^{\left (i \, d x + i \, c\right )} + 2 \right |}^{4} + 16 \, \cos \left (d x + c\right )^{4} + 16 \, \sin \left (d x + c\right )^{4} + 8 \, {\left (\cos \left (d x + c\right )^{2} - \sin \left (d x + c\right )^{2} - 2 \, \cos \left (d x + c\right ) + 1\right )} {\left | 2 \, e^{\left (i \, d x + i \, c\right )} + 2 \right |}^{2} - 64 \, \cos \left (d x + c\right )^{3} + 32 \, {\left (\cos \left (d x + c\right )^{2} - 2 \, \cos \left (d x + c\right ) + 1\right )} \sin \left (d x + c\right )^{2} + 96 \, \cos \left (d x + c\right )^{2} - 64 \, \cos \left (d x + c\right ) + 16\right )}^{\frac {1}{4}} \cos \left (\frac {1}{2} \, \arctan \left (\frac {8 \, {\left (\cos \left (d x + c\right ) - 1\right )} \sin \left (d x + c\right )}{{\left | 2 \, e^{\left (i \, d x + i \, c\right )} + 2 \right |}^{2}}, \frac {{\left | 2 \, e^{\left (i \, d x + i \, c\right )} + 2 \right |}^{2} + 4 \, \cos \left (d x + c\right )^{2} - 4 \, \sin \left (d x + c\right )^{2} - 8 \, \cos \left (d x + c\right ) + 4}{{\left | 2 \, e^{\left (i \, d x + i \, c\right )} + 2 \right |}^{2}}\right )\right ) + 2 \, \cos \left (d x + c\right ) - 2}{{\left | 2 \, e^{\left (i \, d x + i \, c\right )} + 2 \right |}}\right ) - \sqrt {a} \arctan \left ({\left (\cos \left (2 \, d x + 2 \, c\right )^{2} + \sin \left (2 \, d x + 2 \, c\right )^{2} + 2 \, \cos \left (2 \, d x + 2 \, c\right ) + 1\right )}^{\frac {1}{4}} \sin \left (\frac {1}{2} \, \arctan \left (\sin \left (2 \, d x + 2 \, c\right ), \cos \left (2 \, d x + 2 \, c\right ) + 1\right )\right ) + \sin \left (d x + c\right ), {\left (\cos \left (2 \, d x + 2 \, c\right )^{2} + \sin \left (2 \, d x + 2 \, c\right )^{2} + 2 \, \cos \left (2 \, d x + 2 \, c\right ) + 1\right )}^{\frac {1}{4}} \cos \left (\frac {1}{2} \, \arctan \left (\sin \left (2 \, d x + 2 \, c\right ), \cos \left (2 \, d x + 2 \, c\right ) + 1\right )\right ) + \cos \left (d x + c\right )\right )\right )} B}{a d} \]
[In]
[Out]
Exception generated. \[ \int \frac {\cos (c+d x) \left (B \sec (c+d x)+C \sec ^2(c+d x)\right )}{\sqrt {a+a \sec (c+d x)}} \, dx=\text {Exception raised: TypeError} \]
[In]
[Out]
Timed out. \[ \int \frac {\cos (c+d x) \left (B \sec (c+d x)+C \sec ^2(c+d x)\right )}{\sqrt {a+a \sec (c+d x)}} \, dx=\int \frac {\cos \left (c+d\,x\right )\,\left (\frac {B}{\cos \left (c+d\,x\right )}+\frac {C}{{\cos \left (c+d\,x\right )}^2}\right )}{\sqrt {a+\frac {a}{\cos \left (c+d\,x\right )}}} \,d x \]
[In]
[Out]